import { createBrowserRouter } from 'react-router-dom'
import { lazy } from 'react'
import {
    MenuFoldOutlined,
    MenuUnfoldOutlined,
    UploadOutlined,
    UserOutlined,
    VideoCameraOutlined,
} from '@ant-design/icons';

const Home = lazy(() => import('../page/home/Index'))
const Data = lazy(() => import('../page/data/Index'))
const Child = lazy(() => import('../page/child/Index'))
const App = lazy(() => import('../App'))

type routesType = {
    path: string,
    element: JSX.Element,
    children?: routesType,
    icon?: any,
    label?: string
}[]

export const routesItem: routesType = [
    {
        path: '/home',
        element: <Home />,
        icon: <UserOutlined />,
        label: '首页'
    },
    {
        path: '/data',
        element: <Data />,
        icon: <UserOutlined />,
        label: '文档',
        children: [
            {
                path: '/data/child',
                element: <Child />,
                icon: <UserOutlined />,
                label: '文档案列'
            },
        ]
    }
]

const routes: routesType = [
    {
        path: '/',
        element: <App />,
        children:routesItem
    }
]

const router = createBrowserRouter(routes)
export default router